package main
import (
    vv "gitee.com/pkg/api/meta"
)
type EndPoint struct {
    Host     string `json:"host,omitempty"`
    Port     string `json:"port,omitempty"`
    Protocol string `json:"protocol,omitempty"`
}

type LoadBalancer struct {
    Servers        []string    `json:"servers,omitempty"`
    Passhostheader bool        `json:"passhostheader,omitempty"`
    Endpoints      []*EndPoint `json:"endpoints,omitempty"`
}

type Service struct {
    Group        string        `json:"group,omitempty"`
    Name         string        `json:"name,omitempty"`
    Protocol     string        `json:"protocol,omitempty"`
    Rule         string        `json:"rule,omitempty"`
    Loadbalancer *LoadBalancer `json:"loadbalancer,omitempty"`
}

type Router struct {
    Entrypoints []string `json:"entrypoints,omitempty"`
    Service     string   `json:"service,omitempty"`
    Rule        string   `json:"rule,omitempty"`
}

type EntryPoint struct {
    Host     string `json:"host,omitempty"`
    Port     string `json:"port,omitempty"`
    Protocol string `json:"protocol,omitempty"`
}

type Http struct {
    Routers     map[string]*Router     `json:"routers,omitempty"`
    Services    map[string]*Service    `json:"services,omitempty"`
    Entrypoints map[string]*EntryPoint `json:"entrypoints,omitempty"`
    Metadata    *vv.MetaData           `json:"metadata,omitempty"`
}
